﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Gozib.Web.Models.Bus
{
    public class BusBookingInfo
    {
        public BusBookingInfo()
        {
            PaymentDetail = new PaymentInfo();
        }

        public string RouteScheduleId { get; set; }
        public string FromCityId { get; set; }
        public string FromCityName { get; set; }
        public string ToCityId { get; set; }
        public string ToCityName { get; set; }
        public string JourneyDate { get; set; }
        public string JourneyTime { get; set; }
        public string ArrivalDate { get; set; }
        public string ArrivalTime { get; set; }
        public string BordingPoint { get; set; }
        public string BordingPointTime { get; set; }
        public string BusOperator { get; set; }
        public string BusType { get; set; }
        public string CustomerEmail { get; set; }
        public string CustomerMobileNo { get; set; }
        public PaymentInfo PaymentDetail { get; set; }
        public IList<SelectedSeat> SelectedSeats { get; set; }

        public decimal Discount { get; set; }
        public decimal ServiceFee { get; set; }        
        public decimal FareTotal { get { return SelectedSeats == null ? 0 : SelectedSeats.Sum(x => Convert.ToDecimal(x.Fare)); } }
        public decimal GrandTotal { get; set; }
    }

    public class SelectedSeat
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string SeatNo {get; set;}
        public string Fare {get;set;}
        public string Age { get; set; }
        public bool IsFemale { get; set; }
    }

    public class PaymentInfo
    {
        public string CardHolderName { get; set; }
        public string CardNumber { get; set; }
        public string ExpiryMonth { get; set; }
        public string ExpiryYear { get; set; }
        public string CVV { get; set; }
    }
}